package com.zwq.poker.controller;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.zwq.common.exception.BusinessException;
import com.zwq.common.result.ResponseResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Stack;

@RequestMapping("/test")
@RestController
@RefreshScope
@Tag(name = "测试类")
public class TestController {

    @Value("${hello:123}")
    public String hello;


    @ApiOperationSupport(author = "zwq")
    @Operation(summary = "测试")
    @Parameter(name = "token",description = "token",required = true)
    @GetMapping("/hello")
    public ResponseResult<String> test(){
        if (true){
            throw new BusinessException("测试异常");
        }

        return ResponseResult.success(hello);
    }


}
